import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import('../layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/HomeView')
      },
      {
        path: 'user',
        name: 'user',
        component: () => import('@/views/UserView')
      },
      {
        path: 'exercise',
        name: 'exercise',
        component: () => import('@/views/ExerciseView')
      },
      {
        path: 'grade',
        name: 'grade',
        component: () => import('@/views/GradeView')
      },
      {
        path: 'analysis',
        name: 'analysis',
        component: () => import('@/views/AnalysisView')
      },
      {
        path: 'collect',
        name: 'collect',
        component: () => import('@/views/CollectView')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
